Color
The Color Module for the computer API!
Functions
newSingluar
sm.scrapcomputers.color.newSingluar( rgbNum )
Creates a new color from 1 value. Whatever rgbNum's value has will be set on R, G, and B.
This means it's grayscale only!
Arguments:
- rgbNum [ number ] The color value that will be set on R, G, and B.
Returns:
- [ Color ] The generated color.
random
sm.scrapcomputers.color.random( from, to )
Generates a random color from whatever range you want.
Arguments:
- from [ number ] The starting range.
- to [ number ] The ending range.
Returns:
- [ Color ] The generated color.
random0to1
sm.scrapcomputers.color.random0to1()
Generates a random color from 0 to 1.
Returns:
- [ Color ] The generated color.
generateGradient
sm.scrapcomputers.color.generateGradient( colors, numColors )
This generates an interpolated gradient between the colors provided and is dependent on the ammount of gradient specified.
Arguments:
- colors [ Color[] ] The table of colors to generate the gradient from.
- numColors [ integer ] The ammount of blending each color gets in the gradient table.
Returns:
- [ Color[] ] The generated gradient table.